package com.example.streamdemo.controller;

import com.example.streamdemo.producer.MyMessageProducer;
import com.example.streamdemo.producer.MyMessageProducer2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Package: com.example.streamdemo.controller
 * @ClassName: ProducerController
 * @Author: Think
 * @CreateTime: 2021/7/15 16:40
 * @Description:
 */
@RestController
public class ProducerController2 {

    @Autowired
    private MyMessageProducer2 producer;

    @GetMapping("/sendMessage2")
    public String sendMessage(){
        producer.send("hello spring cloud stream using customize channel!");
        return "OK";
    }

}
